home *** CD-ROM | disk | FTP | other *** search
/ OpenGL Superbible (2nd Edition) / OpenGL SuperBible e2.iso / tools / FLTK-1.0.6 / test / inactive.cxx < prev    next >
Encoding:
C/C++ Source or Header  |  1999-09-27  |  3.0 KB  |  101 lines

  1. // generated by Fast Light User Interface Designer (fluid) version 1.00
  2.  
  3. #include "inactive.h"
  4.  
  5. Fl_Group *the_group=(Fl_Group *)0;
  6.  
  7. Fl_Menu_Item menu_menu[] = {
  8.  {"item", 0,  0, 0, 0, 0, 0, 14, 0},
  9.  {"item", 0,  0, 0, 0, 0, 0, 14, 0},
  10.  {"item", 0,  0, 0, 0, 0, 0, 14, 0},
  11.  {"item", 0,  0, 0, 0, 0, 0, 14, 0},
  12.  {"item", 0,  0, 0, 0, 0, 0, 14, 0},
  13.  {0}
  14. };
  15.  
  16. static void cb_active(Fl_Button*, void*) {
  17.   the_group->activate();
  18. }
  19.  
  20. static void cb_inactive(Fl_Button*, void*) {
  21.   the_group->deactivate();
  22. }
  23.  
  24. int main(int argc, char **argv) {
  25.   Fl_Window* w;
  26.   { Fl_Window* o = new Fl_Window(420, 295);
  27.     w = o;
  28.     { Fl_Group* o = the_group = new Fl_Group(25, 25, 375, 235, "activate()/deactivate() called on this Fl_Group");
  29.       o->box(FL_ENGRAVED_FRAME);
  30.       o->align(FL_ALIGN_TOP|FL_ALIGN_INSIDE);
  31.       new Fl_Button(50, 50, 105, 25, "button");
  32.       { Fl_Group* o = new Fl_Group(50, 100, 105, 85, "Child group");
  33.         o->box(FL_DOWN_FRAME);
  34.         { Fl_Check_Button* o = new Fl_Check_Button(50, 100, 105, 25, "red");
  35.           o->type(102);
  36.           o->down_box(FL_DIAMOND_DOWN_BOX);
  37.           o->labelcolor(1);
  38.         }
  39.         { Fl_Check_Button* o = new Fl_Check_Button(50, 120, 105, 25, "green");
  40.           o->type(102);
  41.           o->down_box(FL_DIAMOND_DOWN_BOX);
  42.           o->selection_color(2);
  43.           o->labelcolor(2);
  44.         }
  45.         { Fl_Check_Button* o = new Fl_Check_Button(50, 140, 105, 25, "blue");
  46.           o->type(102);
  47.           o->down_box(FL_DIAMOND_DOWN_BOX);
  48.           o->selection_color(4);
  49.           o->labelcolor(4);
  50.         }
  51.         { Fl_Check_Button* o = new Fl_Check_Button(50, 160, 105, 25, "white");
  52.           o->type(102);
  53.           o->down_box(FL_DIAMOND_DOWN_BOX);
  54.           o->selection_color(7);
  55.           o->labelcolor(7);
  56.         }
  57.         o->end();
  58.       }
  59.       { Fl_Slider* o = new Fl_Slider(165, 50, 24, 150, "Fl_Slider");
  60.         o->value(0.5);
  61.       }
  62.       { Fl_Input* o = new Fl_Input(195, 50, 195, 30);
  63.         o->static_value("Fl_Input");
  64.       }
  65.       { Fl_Menu_Button* o = new Fl_Menu_Button(235, 105, 110, 30, "menu");
  66.         o->menu(menu_menu);
  67.       }
  68.       { Fl_Box* o = new Fl_Box(240, 205, 145, 50, "Fl_Box");
  69.         o->box(FL_EMBOSSED_FRAME);
  70.         o->labeltype(FL_SHADOW_LABEL);
  71.         o->labelfont(3);
  72.         o->labelsize(38);
  73.       }
  74.       { Fl_Value_Output* o = new Fl_Value_Output(255, 165, 130, 30, "value:");
  75.         o->maximum(10000);
  76.         o->step(1);
  77.         o->textfont(5);
  78.         o->textsize(24);
  79.         o->textcolor(4);
  80.       }
  81.       { Fl_Scrollbar* o = new Fl_Scrollbar(40, 220, 180, 20, "scrollbar");
  82.         o->type(1);
  83.         o->maximum(100);
  84.       }
  85.       o->end();
  86.     }
  87.     { Fl_Button* o = new Fl_Button(25, 265, 185, 25, "active");
  88.       o->type(102);
  89.       o->value(1);
  90.       o->callback((Fl_Callback*)cb_active);
  91.     }
  92.     { Fl_Button* o = new Fl_Button(220, 265, 180, 25, "inactive");
  93.       o->type(102);
  94.       o->callback((Fl_Callback*)cb_inactive);
  95.     }
  96.     o->end();
  97.   }
  98.   w->show(argc, argv);
  99.   return Fl::run();
  100. }
  101.